package com.example.app.service.impl;

import com.example.app.dao.SystemConfigRepository;
import com.example.app.model.SystemConfig;
import com.example.app.service.SystemConfigService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by wangtao on 2018/2/3.
 */
@Service
public class SystemConfigServiceImpl implements SystemConfigService {

    private static final Logger logger = Logger.getLogger(SystemConfigServiceImpl.class);

    @Autowired
    private SystemConfigRepository systemConfigRepository;

    @Override
    public SystemConfig findOne(Long accountId, Long organId) {
        SystemConfig systemConfig = systemConfigRepository.findByAccountIdAndOrganId(accountId, organId);
        if(systemConfig ==  null){
            systemConfig = new SystemConfig();
        }
        return systemConfig;
    }
}
